package com.fanjun.learning.multithread.Work_Thread_Pattern;

/**
 * Created by fanjun on 16/10/11.
 */
public class WorkerThread extends Thread{
    private final Channel channel;

    public WorkerThread(String name, Channel channel) {
        super(name);
        this.channel = channel;
    }

    @Override
    public void run(){
        while (true){
            Request request = channel.takeRequest();
            request.execute();
        }
    }
}
